package router

import (
	"api-gateway/handler/api"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	v1 := r.Group("/v1")
	{
		user := v1.Group("/user")
		{
			user.POST("/sendSms", api.SendSms)   //发送验证码
			user.POST("/register", api.Register) //注册
			user.POST("/login", api.Login)       //登录
		}
		reservation := r.Group("/reservation")
		{
			reservation.POST("/addReservation", api.AddReservation)  //添加预约
			reservation.GET("/ReservationList", api.ReservationList) //服务列表
		}
		order := r.Group("/order")
		{
			order.POST("/CreateOrder", api.CreateOrder)             //创建订单
			order.POST("/UpdateOrderStatus", api.UpdateOrderStatus) //修改订单状态
			order.GET("/OrderList", api.OrderList)                  //我的订单
		}
		cleaner := v1.Group("/cleaner")
		{
			cleaner.POST("/UpdateCleanerStatus", api.UpdateCleanerStatus) //修改保洁状态
		}
	}
}
